import request from '@/api/request'

function productList(data) {
  return request({
    url: '/api/leju/admin/product/list',
    method: 'get',
    data
  })
}

function switchCode(data) {
  return request({
    url: '/api/leju/admin/product/switchCode',
    method: 'post',
    data
  })
}

function uploadImg(data) {
  return request({
    url: '/api/leju/admin/material/uploadImg',
    method: 'post',
    data
  })
}

function upDate(data) {
  return request({
    url: '/api/leju/admin/product/saveOrUpdate',
    method: 'post',
    data
  })
}

function deLete(data) {
  return request({
    url: '/api/leju/admin/product/delete',
    method: 'get',
    data
  })
}
function getDetail(data) {
  return request({
    url: '/api/leju/admin/product/detail',
    method: 'get',
    data
  })
}
// 获取品牌列表
function getBrandList(data) {
  return request({
    url: '/api/leju/admin/brand/list',
    method: 'get',
    data
  })
}
// 获取sku列表
function getskuList(data) {
  return request({
    url: '/api/leju/admin/productSku/skuList',
    method: 'get',
    data
  })
}
// 删除库存
function deleSku(data) {
  return request({
    url: '/api/leju/admin/productSku/del',
    method: 'get',
    data
  })
}

function upDateSku(data) {
  return request({
    url: '/api/leju/admin/productSku/saveOrUpdate',
    method: 'post',
    data
  })
}

export default {
  productList,
  switchCode,
  uploadImg,
  upDate,
  deLete,
  getDetail,
  getBrandList,
  getskuList,
  upDateSku,
  deleSku
}
